package Lambda.Message;

public class RunnableDemo {
    private static void startThread(Runnable run){
       new Thread(run).start();
    }
    public static void main(String[] args) {
      /*  startThread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"线程启动了！");
            }
        });*/
        //优化后的lambda表达式
        startThread(()->{
            System.out.println(Thread.currentThread().getName()+"线程启动了");
        });
    }
}
